"""
URL configuration for book app.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path
from book import views

app_name = 'book'
urlpatterns = [
    # 首页导航
    path('', views.home, name='home'),

    # 自定义跳转界面：查看所有书籍列表
    path('book/', views.book, name='book'),

    # 自定义跳转界面：查找书籍
    path('book_find/<int:book_id>/', views.book_find, name='book_find'),

    # redirect的三种传入参数形式：字符串
    path('book_string', views.book_string, name='book_string'),

    # redirect的三种传入参数形式：视图名
    path('book_view_name/', views.book_view_name, name='book_view_name'),

    # redirect的三种传入参数形式：视图名加参数
    path('book_view_name_arg/', views.book_view_name_arg, name='book_view_name_arg'),

    # redirect的三种传入参数形式：反向解析
    path('book_reverse/', views.book_reverse, name='book_reverse'),
]
